/*
 * CustomerAction.java
 * 
 * Created on 02/10/2007, 12:43:14 PM
 * 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view.actions;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.bean.Usuario;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import view.common.Constants;
import view.common.struts.CustomActionForm;

import view.common.struts.CustomDispatchAction;

/**
 * @Archivo LoginAction.java
 * @Fecha                @Autor   @Cambios
 * 21/01/2011 02:35:29 PM       moshiro
 */
public class LogoutAction extends CustomDispatchAction {

    private final static String LOGIN = "login";

    @Override
    public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) throws Exception {
        CustomActionForm loginForm = (CustomActionForm) form;
        loginForm.setBean(new Usuario());
        req.getSession().removeAttribute(Constants.SESSION_USER);
        req.getSession().removeAttribute(Constants.SESSION_ELECCION);
        return mapping.findForward(LOGIN);
    }

    
}
